import Vue from 'vue';
import Router from 'vue-router';

import Main from "../views/Main";
import Login from "../views/Login";


import UserIndex from "../views/user/UserIndex";
import RoleIndex from "../views/user/RoleIndex";
import MainMenu from "../views/MainMenu";
import UserTeacher from "../views/user/UserTeacher";
import UserStudent from "../views/user/UserStudent";
import ClassIndex from "../views/class/ClassIndex";
import WechatBindIndex from "../views/system/WechatBindIndex"
import CheckWorkIndex from "../views/checkwork/CheckWorkIndex";
import CheckWorkResult from '../views/checkwork/CheckWorkResult';
import SignInfoIndex from '../views/checkwork/SignInfoIndex';

Vue.use(Router);

export default new Router({
  mode:'history',
  routes:[
    {
      path:'/',
      component:Login
    },
    {
      path:'/login',
      component:Login
    },{
      path: '/main',
      component: Main,
      meta: {
        needLogin: true //需要加校检判断的路由
      },
      children:[
        {path:"/user/userindex",component:UserIndex}
        ,{
          path:'/user/roleindex',
          component:RoleIndex,
          meta: {
            needLogin: true //需要加校检判断的路由
          },
        },
        {
          path:'/user/teacherindex',
          component:UserTeacher,
          meta: {
            needLogin: true //需要加校检判断的路由
          },
        },
        {
          path:'/user/studentindex',
          component:UserStudent,
          meta: {
            needLogin: true //需要加校检判断的路由
          },
        },
        {
          path:'/class/classindex',
          component:ClassIndex,
          meta: {
            needLogin: true //需要加校检判断的路由
          },
        },
        {
          path:'/system/wechatBindIndex',
          component:WechatBindIndex,
          meta: {
            needLogin: true //需要加校检判断的路由
          },
        },
        {
          path:'/checkwork/checkworkIndex',
          component:CheckWorkIndex,
          meta: {
            needLogin: true //需要加校检判断的路由
          },
        },
        {
          path:'/checkwork/checkworkResult',
          name: '/checkwork/checkworkResult',
          component:CheckWorkResult,
          meta: {
            needLogin: true //需要加校检判断的路由
          },
        },
        {
          path:'/checkwork/signInfoIndex',
          name: '/checkwork/signInfoIndex',
          component:SignInfoIndex,
          meta: {
            needLogin: true //需要加校检判断的路由
          },
        },
      ]
    },{
      path: "/menu",
      component: MainMenu,
      meta: {
        needLogin: true //需要加校检判断的路由
      },
    }


  ]
})

